package com.api.demo.dto.business.invoice;


import com.api.demo.dto.business.ApiDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;

/**
 * @description: 申请开票操作DTO
 * @author: yanming
 * @createDate: 2022/09/14 11:32
 */

@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "申请开票操作V2DTO")
public class ApplicationInvoiceV2DTO extends ApiDTO {

    @ApiModelProperty(value = "地址ID")
    private Long addressId;

    @ApiModelProperty(value = "开票备注")
    private String applicationDesc;

    @ApiModelProperty(value = "邮箱")
    private String email;

    @ApiModelProperty(value = "开票类目ID")
    private Long invoiceCatalogId;

    @ApiModelProperty(value = "开票类目名称", required = true)
    @NotBlank(message = "开票类目名称不能为空")
    private String invoiceCatalogName;

    @ApiModelProperty(value = "发票类型", required = true)
    @NotBlank(message = "发票类型不能为空")
    private String invoiceType;

    @ApiModelProperty(value = "发票方式", required = true)
    @NotBlank(message = "发票方式不能为空")
    private String invoiceWay;

    @ApiModelProperty(value = "订单ID", required = true)
    @NotBlank(message = "订单ID不能为空")
    private String id;

    @ApiModelProperty(value = "发票回调地址")
    @Length(max = 500, message = "回调地址长度不能超过500")
    private String notifyUrl;

    @ApiModelProperty(value = "开票金额")
    private BigDecimal billingAmount;

    @ApiModelProperty(value = "地址信息")
    private ApplicationInvoiceV2DTO.AddressVo addressVo;

    @Data
    public static class AddressVo {


        /**
         * 收件人
         */
        private String name;

        /**
         * 手机号
         */
        private String mobile;

        /**
         * 地区
         */
        private String address;

        /**
         * 详细地址
         */
        private String addressDesc;

    }

}

